<?php defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * Permissoes_model
 * @author Thiago Braga <thiago@sitesg.com.br>
 * @access protected
 */
class Configs_model extends CI_Model {

  /**
   * Seleciona os itens do menu do sistema
   * @return object
   */
  function select_menu() {
    return $this->db->query("
      SELECT
        id,
        nome,
        url,
        info,
        conteudo,
        tab,
        dropdown,
        dropdown_id
      FROM
        modulos
      WHERE
        tab = 0
        AND situacao = 'A';")->result();
  }

  /**
   * Seleciona as abas do sistema
   * @return object
   */
  function select_tabs() {
    return $this->db->query("
      SELECT
        id,
        nome,
        url,
        info,
        conteudo,
        tab,
        dropdown,
        dropdown_id
      FROM
        modulos
      WHERE
        tab = 1
        AND situacao = 'A';")->result();
  }

  /**
   * Seleciona os módulos do sistema.
   * @return object
   */
  function select_pageinfo($controller) {
    return $this->db->query("
      SELECT
        info,
        info_edit,
        info_cadastro
      FROM
        modulos
      WHERE
        url = '$controller'
        AND situacao = 'A'
      LIMIT 1;")->row();
  }

  /**
   * Seleciona os módulos do sistema.
   * @return object
   */
  function select_regras($controller) {
    return $this->db->query("
      SELECT
        info
      FROM
        modulos
      WHERE
        url = '$controller'
        AND situacao = 'A'
      LIMIT 1;")->row();
  }

}

/* End of file permissoes_model.php */
/* Location: ./application/models/permissoes_model.php */